################################################################################
# IMPORTS
################################################################################

from django.contrib import admin

from models import Term, TermTranslation, ViewBridge

################################################################################
# ADMIN CLASSES
################################################################################

class TermTranslationInline(admin.StackedInline):
    """ provide support in django admin for the TermTranslation model """
    model = TermTranslation
    extra = 1

class TermAdmin(admin.ModelAdmin):
    """ provide support in django admin for the Term model """
    list_display = ('namefield', 'parent','language',)
    list_filter = ('parent', 'language',)
    ordering = ('namefield','parent',)
    search_fields = ('namefield', 'descriptionfield',)
    inlines = [TermTranslationInline,]

admin.site.register(Term, TermAdmin)

class ViewBridgeAdmin(admin.ModelAdmin):
    """ provide support in django admin for the ViewBridge model """
    list_display = ('name', 'path','params',)
    ordering = ('name','path',)
    search_fields = ('name', 'path',)

admin.site.register(ViewBridge, ViewBridgeAdmin)

